//惰性创建
const LazySingle = (function(){
    let instance
    function Single(){
        const desc = 'single'
        return {
            publicMethod:function(){console.log(desc)},
            publicProperty:'1.0'
        }
    }
    return function(){
        return instance || (instance = Single())
    }
})()

console.log(LazySingle() === LazySingle())
console.log(LazySingle().publicProperty)